<%include pub/admin_head.html%>
    </head>
    <body>
        <!-- Page Container -->
        <div class="page-container">
            <%include pub/admin_nav.html%>
            <!-- Page Content -->
            <div class="page-content">
            	<%include pub/admin_top.html%>
                <div class="page-inner">
                	<div class="page-title">
                        <h3 class="breadcrumb-header">管理员列表</h3>
                        <input type="hidden" value="<%= pagecount%>" id="compagecount">
                        <input type="hidden" value="<%= compageid%>" id="compageid">
                    </div>
                    <div id="main-wrapper">
                        <div class="col-md-12">
                            <table class="table" style="margin-top: 10px;">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>管理员账号</th>
                                        <th>创建时间</th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <%if(data){%>
                                        <%for(let i=0; i< data.length;i++){%>
                                        <tr>
                                            <th scope="row"><%= i+1 %></th>
                                            <td><%= data[i]._id %></td>
                                            <td><%= data[i].username %></td>
                                            <td><%= data[i].time %></td>
                                            <td>
                                              <a href="javascript:;" class="btn btn-danger admin-delete-btn" aid="<%- data[i]._id %>">删除</a>
                                            </td>
                                        </tr>
                                    <%}}%>
                                </tbody>
                            </table>
                            <div id="work-pagination" class="pager row"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <%include pub/foot.html%>
        <script type="text/javascript" src="/plugin/jqpaginator.min.js"></script>
        <script type="text/javascript">
        $(function(){
            var countnums = $('#compagecount').val();
            var currentPage = parseInt($('#compageid').val());
            if(countnums >  39){
                var total = Math.ceil(countnums/40);
                var prev = currentPage -1;
                var next = currentPage +1;
                $.jqPaginator('#work-pagination', {
                    totalPages: total,
                    visiblePages:5,
                    currentPage:currentPage,
                    page: '<li class="page"><a href="/admin/data/{{page}}">{{page}}</a></li>',
                });
            }
        })
        </script>
    </body>
</html>